#include "widget.h"
#include "ui_widget.h"
#include<QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QPushButton* button=new QPushButton(this);
    button->setText(QString("我是一个按钮"));
    connect(button,&QPushButton::clicked,[]() {
        qDebug("Button clicked!");
    });
}

Widget::~Widget()
{
    delete ui;
}

void Widget::handler(){
     qDebug("Button clicked!");
}
